package com.alibaba.shopping_category_customer_api.controller;

import com.alibaba.shopping_common.pojo.Category;
import com.alibaba.shopping_common.result.BaseResult;
import com.alibaba.shopping_common.service.CategoryService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName CategroyController
 * @Description TODO
 * @Author Leo
 * @Date 2024/12/11 10:56
 */
@RestController
@RequestMapping("/user/category")
public class CategoryController {

    @DubboReference
    private CategoryService categoryService;

    /**
     * 查询所有有效的广告信息
     * @return
     */
    @GetMapping("/all")
    public BaseResult<List<Category>>all(){
        List<Category> all = categoryService.findAll();
        return BaseResult.OK(all);
    }
}




